package 比屋作业.day18;
import java.util.*;
public class D18_1 {
    public static void main(String[] args) {
        String string="你好你好好你好abcdefg";
        HashSet<Character> charset=new HashSet<>();
        for (int i=0;i < string.length();i++){
            charset.add(string.charAt(i));
        }
        for (Character c:charset){
            int count=0;
            for (int i=0;i<string.length();i++){
                if (string.charAt(i)==c){
                    count++;
                }
            }
            System.out.println("字符：'"+c+"'出现了"+count+"次");
        }
    }
}
